Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Editing Movies / Editing Tracks


InsertMediaIntoTrack

The InsertMediaIntoTrack function inserts a reference to a media segment into a track. You specify the segment in the media by providing a starting time and duration. You specify the point in the destination track by providing a time in the track.

pascal OSErr InsertMediaIntoTrack (Track theTrack, 
                                    TimeValue trackStart,
                                    TimeValue mediaTime,
                                    TimeValue mediaDuration,
                                    Fixed mediaRate);
theTrack
Specifies the track for this operation. Your application obtains this track identifier from such Movie Toolbox functions as NewMovieTrack and GetMovieTrack (described on page 2-136 and page 2-188, respectively).
trackStart

Contains a time value specifying where the segment is to be inserted. This time value must be expressed in the movie's time scale. If you set this parameter to -1, the media data is added to the end of the track.
mediaTime
Contains a time value specifying the starting point of the segment in the media. This time value must be expressed in the media's time scale.
mediaDuration
Contains a time value specifying the duration of the media's segment. This time value must be expressed in the media's time scale.
mediaRate
Specifies the media's rate. A value of 1.0 indicates the media's natural playback rate. This value should be a positive, nonzero rate.
DESCRIPTION
The InsertMediaIntoTrack function inserts the media segment into the track at the specified location. The Movie Toolbox determines the duration of the segment in the track based on the media rate and duration information you provide.

You use this function after you have added samples to a media using the functions described in "Adding Samples to Media Structures" beginning on page 2-254.
If you play the track before you call this function, the track does not contain the new media data.

ERROR CODES
invalidTrack-2009This track is corrupted or invalid
invalidDuration-2014This duration value is invalid
invalidTime-2015This time value is invalid

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996